'''
Author: shenghao.xu
Date: 2023-03-20 19:27:47
LastEditors: shenghao.xu
LastEditTime: 2023-03-30 22:27:17
FilePath: \hart\test\run.py
Description: 
email:545403892@qq.com
Copyright (c) 2023 by shenghao.xu, All Rights Reserved. 
'''

import unittest
from unittestreport import TestRunner
import os


case_path = "test/"
suite = unittest . defaultTestLoader . discover(case_path, pattern="test_*.py")
BasePath = os.path.dirname(__file__)  # 获取当前文件所在路径

if __name__ == "__main__":
    fp = BasePath + "\\report"
    # filename为文件名称，report_dir报告输出位置，title测试标题，tester测试测试人员，desc描述
    runner = TestRunner(suite, filename="report.html", report_dir=fp,
                        title="测试报告", tester="许晟昊", desc="许晟昊执行的测试用例", templates=2)
    runner.run()
